#include <stdio.h>
#include <vector>
#include <iostream>
#include <algorithm>
#include <complex>
#include <queue>
#include <cmath>
#include <numeric>
#include <ctime>
using namespace std;

vector<double> m;
vector<vector<double> > S;
vector<double> gauss;
vector<vector<double> > C;


int main()
{
	freopen("input.in", "r", stdin);
	freopen("output.out", "w", stdout);
	int N;
	scanf("%d", &N);
	m.resize(N);
	S.resize(N, vector<double>(N));
	C.resize(N, vector<double>(N));
	gauss.resize(N);
	for (int i = 0; i  < N; ++i)
		scanf("%lf", &m[i]);
	for (int i = 0; i < N; ++i)
		for (int  j = 0; j < N; ++j)
			scanf("%lf", &S[i][j]);
	C[0][0] = sqrt(S[0][0]);
	for (int i = 1; i < N; ++i)
		for (int j = 0; j <= i; ++j)
		{
			C[i][j] = S[i][j];
			for (int k = 0; k < j; ++k)
				C[i][j] -= C[i][k]* C[j][k];
			double temp = S[j][j];
			for (int k = 0; k < j; ++k)
				temp -= C[j][k] * C[j][k];
			C[i][j] /= sqrt(temp);
		}
		vector<double> temp(N);
		srand((unsigned int)time(NULL));

     for (int i = 0; i < N; ++i)
		 temp[i] = sqrt( - 2.0 * log((double)(rand() %  100000000)/ 100000000) * cos(2 * 3.14159265 * (double)(rand() %  100000000) / 100000000));
	for (int i = 0; i < N; ++i)
		gauss[i] = inner_product(C[i].begin(), C[i].end(), temp.begin(), 0.0);
	for (int i = 0; i < N; ++i)
		gauss[i] += m[i];
	for (int i = 0; i <N; ++i)
		cout << gauss[i] << endl;
}


